import {setStorage, getStorage, removeStorage} from "./index";
//储存UserId
const setStorageUserId = (userId) => {
  setStorage("userId", userId);
};

//获取UserId
const getStorageUserId = () => {
  return getStorage("userId");
};  

//删除UserId
const removeStorageUserId = () => {
  removeStorage("userId");
};

//储存token
const setStorageToken = (token) => {
  setStorage("token", token);
};

//获取token
const getStorageToken = () => {
  return getStorage("token");
};

//删除token
const removeStorageToken = () => {
  removeStorage("token");
};

//储存localServerPort
const setStorageLocalServerPort = (port) => {
  setStorage("localServerPort", port);
};

//获取localServerPort
const getStorageLocalServerPort = () => {
  return getStorage("localServerPort");
};

//删除localServerPort
const removeStorageLocalServerPort = () => {
  removeStorage("localServerPort");
};

//储存localFileFolder
const setStorageLocalFileFolder = (folder) => {
  setStorage("localFileFolder", folder);
};

//获取localFileFolder
const getStorageLocalFileFolder = () => {
  return getStorage("localFileFolder");
};

//删除localFileFolder
const removeStorageLocalFileFolder = () => {
  removeStorage("localFileFolder");
}; 

//储存localFileFolder
const setStorageLocalSessionId = (sessionId) => {
  setStorage("currentSessionId", sessionId);
};

//获取localFileFolder
const getStorageLocalSessionId = () => {
  return getStorage("currentSessionId");
};

//删除localFileFolder
const removeStorageLocalSessionId = () => {
  removeStorage("currentSessionId");
}; 

export {
    setStorageUserId,
    getStorageUserId,
    removeStorageUserId,
    setStorageToken,
    getStorageToken,
    removeStorageToken,
    setStorageLocalServerPort,
    getStorageLocalServerPort,
    removeStorageLocalServerPort,
    setStorageLocalFileFolder,
    getStorageLocalFileFolder,
    removeStorageLocalFileFolder,
    setStorageLocalSessionId,
    getStorageLocalSessionId,
    removeStorageLocalSessionId
}